package com.example.demo.Controller;

import com.example.demo.Config.StudentConfig;
import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/prop")
public class PropertiseController {
//    @Value("${my.key}")
//    private String myKey;
//
//    @RequestMapping("ReadValue")
//    public String readValue(){
//        return "从配置文件中读取配置信息"+myKey;
//    }
    @Autowired
    public StudentConfig studentConfig;

//    @PostConstruct
//    public void readValue2(){
//        System.out.println("从配置文件中读取配置信息"+myKey);
//    }
    @PostConstruct
    public void readObject(){
        System.out.println(studentConfig.toString());
    }
}
